//
//  UIImageView+STImageView.m
//  OCVVeibo
//
//  Created by leergou on 16/7/23.
//  Copyright © 2016年 WhiteHouse. All rights reserved.
//

#import "UIImageView+STImageView.h"


@implementation UIImageView (STImageView)

- (instancetype)initWithImageName:(NSString *)imageName{
    
    if (self = [super init]) {
        
        [self setImage:[UIImage imageNamed:imageName]];
        [self sizeToFit];
    }
    return self;
}


- (instancetype)initWithNormalImage:(NSString *)normalImageName highlightedImage:(NSString *)hightlightedImageName{
    
    if (self = [super init]) {
        [self setImage:[UIImage imageNamed:normalImageName]];
        [self setImage:[UIImage imageNamed:hightlightedImageName]];
        [self sizeToFit];
    }
    return self;
}



- (instancetype)initWithImageUrl:(NSString *)imageUrl{
    
    if (self = [super init]) {
        
        [self sd_setImageWithURL:[NSURL URLWithString:imageUrl]];
//        [self sizeToFit];
    }
    return self;

    
}


- (instancetype)initWithImageUrl:(NSString *)imageUrl placeHolderImage:(NSString *)placeHolderImgName{

    
    if (self = [super init]) {
        
        [self sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:placeHolderImgName]];
//                [self sizeToFit];
    }
    return self;
}

@end
